package com.xckj.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xckj.dao.MethodTreeMapper;
import com.xckj.entity.MethodTree;
import com.xckj.service.MethodTreeService;
import com.xckj.utils.ReturnT;

/**
 * @description method_tree
 * @author yanchf
 * @date 2024-01-14
 */
@Service
public class MethodTreeServiceImpl implements MethodTreeService {

	@Resource
	private MethodTreeMapper methodTreeMapper;


	@Override
	public Object insert(MethodTree methodTree) {

		// valid
		if (methodTree == null) {
			return ReturnT.error("必要参数缺失");
        }

		methodTreeMapper.insert(methodTree);
        return ReturnT.success();
	}


	@Override
	public Object delete(int id) {
		int ret = methodTreeMapper.delete(id);
		return ret>0?ReturnT.success():ReturnT.error();
	}


	@Override
	public Object update(MethodTree methodTree) {
		int ret = methodTreeMapper.update(methodTree);
		return ret>0?ReturnT.success():ReturnT.error();
	}


	@Override
	public MethodTree load(int id) {
		return methodTreeMapper.load(id);
	}

}